//
//  Header.h
//  Poem
//
//  Created by xuPeng on 2017/12/27.
//  Copyright © 2017年 xuPeng. All rights reserved.
//

#ifndef Header_h
#define Header_h

// 1.1 Log
#ifdef DEBUG // 调试版本
#define MTLog(...) NSLog(__VA_ARGS__)
#else // 发布版本
#define MTLog(...)
#endif


#define APP_VERSION() \
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]

#define kTipAlert(s, ...) {UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示"                                                      message:[NSString stringWithFormat:(s), ##__VA_ARGS__]                                                       preferredStyle:UIAlertControllerStyleAlert];UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault                                                     handler:^(UIAlertAction * action) {}];[alert addAction:defaultAction];[self presentViewController:alert animated:YES completion:nil];}

#define kTipAlert2(s, ...) {UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示"                                                      message:[NSString stringWithFormat:(s), ##__VA_ARGS__]                                                       preferredStyle:UIAlertControllerStyleAlert];UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleDefault                                                     handler:^(UIAlertAction * action) {}];[alert addAction:defaultAction];UIAlertAction* defaultAction2 = [UIAlertAction actionWithTitle:@"不知道" style:UIAlertActionStyleDefault                                                     handler:^(UIAlertAction * action) {}];[alert addAction:defaultAction2];[self presentViewController:alert animated:YES completion:nil];}

#define kKeyWindow [UIApplication sharedApplication].keyWindow
#define kScreenBounds [UIScreen mainScreen].bounds
#define kScreenW [UIScreen mainScreen].bounds.size.width
#define kScreenH [UIScreen mainScreen].bounds.size.height

#define kDevice_Is_iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDevice_Is_iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDevice_Is_iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)

#define kVersionCoding [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]
#define kVersionBuildCoding [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]


#endif /* Header_h */
